home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.sprintlink.net!news1!ind-004-236-178
- From: dlmiller@iquest.net (Doug Miller)
- Subject: Re: 16-bit memset?
- X-Nntp-Posting-Host: ind-004-236-178.iquest.net
- Message-ID: <DoJABC.Hy7@iquest.net>
- Sender: news@iquest.net (News Admin)
- Organization: IQuest Network Services
- X-Newsreader: News Xpress Version 1.0 Beta #2.1
- References: <joules-1803962243060001@badboy.mit.edu> <4ill6r$qnm@nntp.interaccess.com>
- Date: Tue, 19 Mar 1996 21:30:39 GMT
-
- +Julian Orbanes wrote:
- +>I am looking quick way to set a series of 16-bit values to one value.
- +>
- +>Analagous to how memset set works with 8-bit values. (For graphics
- +>purposes).
-
- char *bigstuff;
- . .
- /* assuming that: */
- /* 1) you have allocated storage for bigstuff */
- /* 2) it is a null-terminated string of the desired FINAL length */
- /* 3) you have loaded the value you wish to propagate into the first 2 bytes */
-
- strncpy (bigstuff + 2, bigstuff, (strlen (bigstuff) - 2));
-